package com.ugoodtech.mdcc.core.utils;

import com.fasterxml.jackson.annotation.JsonIgnore;
import org.springframework.beans.BeanUtils;

import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * User: Kotone
 * Date: 2017/9/21
 * Time: 15:17
 * To change this template use File | Settings | File Templates.
 */
public class BaseDto<T> {
    @JsonIgnore
    public T originData;

    @JsonIgnore
    public Map<String,Object> source;

    public T getOriginData() {
        return originData;
    }

    public void setOriginData(T originData) {
        this.originData = originData;
        BeanUtils.copyProperties(originData,this);
    }

    public Map<String, Object> getSource() {
        return source;
    }

    public void setSource(Map<String, Object> source) {
        this.source = source;
    }
}
